package aop03;

import org.springframework.aop.ThrowsAdvice;

import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.Date;

public class ExceptionAdvice implements ThrowsAdvice {
     public void afterThrowing(Method method, Object[] args, Object target, Exception ex){
         System.out.println("在"+ new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())+"时间，请求结束了"+target+" 中"+method.getName()+"抛出了异常"+ex);

     }


}
